home *** CD-ROM | disk | FTP | other *** search
/ Inter.Net 55-1 / Inter.Net 55-1.iso / CBuilder / Setup / BCB / data.z / midles.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-09  |  6.0 KB  |  231 lines

  1. /*++
  2.  
  3. Copyright (c) 1991-1996 Microsoft Corporation
  4.  
  5. Module Name:
  6.  
  7.     midles.h
  8.  
  9. Abstract:
  10.  
  11.     This module contains definitions needed for encoding/decoding
  12.     support (serializing/deserializing a.k.a. pickling).
  13.  
  14. --*/
  15.  
  16. #ifndef __MIDLES_H__
  17. #define __MIDLES_H__
  18. #pragma option push -b
  19.  
  20.  
  21. #include <rpcndr.h>
  22.  
  23.  
  24. //
  25. // Set the packing level for RPC structures for Dos and Windows.
  26. //
  27.  
  28. #if defined(__RPC_DOS__) || defined(__RPC_WIN16__)
  29. #pragma pack(2)
  30. #endif
  31.  
  32. #if defined (__BORLANDC__)
  33. #  include <pshpack8.h>
  34. #endif
  35.  
  36. #ifdef __cplusplus
  37. extern "C" {
  38. #endif
  39.  
  40. /*
  41.  *  Pickling support
  42.  */
  43. typedef enum
  44. {
  45.     MES_ENCODE,
  46.     MES_DECODE,
  47. } MIDL_ES_CODE;
  48.  
  49. typedef enum
  50. {
  51.     MES_INCREMENTAL_HANDLE,
  52.     MES_FIXED_BUFFER_HANDLE,
  53.     MES_DYNAMIC_BUFFER_HANDLE
  54. } MIDL_ES_HANDLE_STYLE;
  55.  
  56.  
  57. typedef void (__RPC_USER *  MIDL_ES_ALLOC )
  58.                 ( IN OUT  void __RPC_FAR * state,
  59.                   OUT     char __RPC_FAR *  __RPC_FAR * pbuffer,
  60.                   IN OUT  unsigned int __RPC_FAR * psize );
  61.  
  62. typedef void (__RPC_USER *  MIDL_ES_WRITE)
  63.                 ( IN OUT  void __RPC_FAR * state,
  64.                   IN      char __RPC_FAR * buffer,
  65.                   IN      unsigned int  size );
  66.  
  67. typedef void (__RPC_USER *  MIDL_ES_READ)
  68.                 ( IN OUT  void __RPC_FAR * state,
  69.                   OUT     char __RPC_FAR *  __RPC_FAR * pbuffer,
  70.                   IN OUT     unsigned int __RPC_FAR * psize );
  71.  
  72. typedef struct _MIDL_ES_MESSAGE
  73. {
  74.     MIDL_STUB_MESSAGE                       StubMsg;
  75.     MIDL_ES_CODE                            Operation;
  76.     void __RPC_FAR *                        UserState;
  77.     unsigned long                           MesVersion:8;
  78.     unsigned long                           HandleStyle:8;
  79.     unsigned long                           HandleFlags:8;
  80.     unsigned long                           Reserve:8;
  81.     MIDL_ES_ALLOC                           Alloc;
  82.     MIDL_ES_WRITE                           Write;
  83.     MIDL_ES_READ                            Read;
  84.     unsigned char __RPC_FAR *               Buffer;
  85.     unsigned long                           BufferSize;
  86.     unsigned char __RPC_FAR * __RPC_FAR *   pDynBuffer;
  87.     unsigned long __RPC_FAR *               pEncodedSize;
  88.     RPC_SYNTAX_IDENTIFIER                   InterfaceId;
  89.     unsigned long                           ProcNumber;
  90.     unsigned long                           AlienDataRep;
  91.     unsigned long                           IncrDataSize;
  92.     unsigned long                           ByteCount;
  93. } MIDL_ES_MESSAGE, __RPC_FAR * PMIDL_ES_MESSAGE;
  94.  
  95. typedef  PMIDL_ES_MESSAGE  MIDL_ES_HANDLE;
  96.  
  97. RPC_STATUS  RPC_ENTRY
  98. MesEncodeIncrementalHandleCreate(
  99.     void      __RPC_FAR *  UserState,
  100.     MIDL_ES_ALLOC          AllocFn,
  101.     MIDL_ES_WRITE          WriteFn,
  102.     handle_t  __RPC_FAR *  pHandle );
  103.  
  104. RPC_STATUS  RPC_ENTRY
  105. MesDecodeIncrementalHandleCreate(
  106.     void      __RPC_FAR *  UserState,
  107.     MIDL_ES_READ           ReadFn,
  108.     handle_t  __RPC_FAR *  pHandle );
  109.  
  110.  
  111. RPC_STATUS  RPC_ENTRY
  112. MesIncrementalHandleReset(
  113.     handle_t             Handle,
  114.     void    __RPC_FAR *  UserState,
  115.     MIDL_ES_ALLOC        AllocFn,
  116.     MIDL_ES_WRITE        WriteFn,
  117.     MIDL_ES_READ         ReadFn,
  118.     MIDL_ES_CODE         Operation );
  119.  
  120.  
  121. RPC_STATUS  RPC_ENTRY
  122. MesEncodeFixedBufferHandleCreate(
  123.     char __RPC_FAR *            pBuffer,
  124.     unsigned long               BufferSize,
  125.     unsigned long __RPC_FAR *   pEncodedSize,
  126.     handle_t  __RPC_FAR *       pHandle );
  127.  
  128. RPC_STATUS  RPC_ENTRY
  129. MesEncodeDynBufferHandleCreate(
  130.     char __RPC_FAR * __RPC_FAR *    pBuffer,
  131.     unsigned long    __RPC_FAR *    pEncodedSize,
  132.     handle_t  __RPC_FAR *           pHandle );
  133.  
  134. RPC_STATUS  RPC_ENTRY
  135. MesDecodeBufferHandleCreate(
  136.     char __RPC_FAR *        pBuffer,
  137.     unsigned long           BufferSize,
  138.     handle_t  __RPC_FAR *   pHandle );
  139.  
  140.  
  141. RPC_STATUS  RPC_ENTRY
  142. MesBufferHandleReset(
  143.     handle_t                        Handle,
  144.     unsigned long                   HandleStyle,
  145.     MIDL_ES_CODE                    Operation,
  146.     char __RPC_FAR * __RPC_FAR *    pBuffer,
  147.     unsigned long                   BufferSize,
  148.     unsigned long __RPC_FAR *       pEncodedSize );
  149.  
  150.  
  151. RPC_STATUS  RPC_ENTRY
  152. MesHandleFree( handle_t  Handle );
  153.  
  154. RPC_STATUS  RPC_ENTRY
  155. MesInqProcEncodingId(
  156.     handle_t                    Handle,
  157.     PRPC_SYNTAX_IDENTIFIER      pInterfaceId,
  158.     unsigned long __RPC_FAR *   pProcNum );
  159.  
  160.  
  161. #if defined(_MIPS_) || defined(_ALPHA_) || defined(_PPC_)
  162. #define __RPC_UNALIGNED   __unaligned
  163. #else
  164. #define __RPC_UNALIGNED
  165. #endif
  166.  
  167. void  RPC_ENTRY    I_NdrMesMessageInit( PMIDL_STUB_MESSAGE );
  168.  
  169. size_t  RPC_ENTRY
  170. NdrMesSimpleTypeAlignSize ( handle_t );
  171.  
  172. void  RPC_ENTRY
  173. NdrMesSimpleTypeDecode(
  174.     handle_t            Handle,
  175.     void __RPC_FAR *    pObject,
  176.     short               Size );
  177.  
  178. void  RPC_ENTRY
  179. NdrMesSimpleTypeEncode(
  180.     handle_t            Handle,
  181.     PMIDL_STUB_DESC     pStubDesc,
  182.     void __RPC_FAR *    pObject,
  183.     short               Size );
  184.  
  185.  
  186. size_t  RPC_ENTRY
  187. NdrMesTypeAlignSize(
  188.     handle_t            Handle,
  189.     PMIDL_STUB_DESC     pStubDesc,
  190.     PFORMAT_STRING      pFormatString,
  191.     void __RPC_FAR *    pObject );
  192.  
  193. void  RPC_ENTRY
  194. NdrMesTypeEncode(
  195.     handle_t            Handle,
  196.     PMIDL_STUB_DESC     pStubDesc,
  197.     PFORMAT_STRING      pFormatString,
  198.     void __RPC_FAR *    pObject );
  199.  
  200. void  RPC_ENTRY
  201. NdrMesTypeDecode(
  202.     handle_t            Handle,
  203.     PMIDL_STUB_DESC     pStubDesc,
  204.     PFORMAT_STRING      pFormatString,
  205.     void __RPC_FAR *    pObject );
  206.  
  207. void  RPC_VAR_ENTRY
  208. NdrMesProcEncodeDecode(
  209.     handle_t            Handle,
  210.     PMIDL_STUB_DESC     pStubDesc,
  211.     PFORMAT_STRING      pFormatString,
  212.     ... );
  213.  
  214.  
  215. #ifdef __cplusplus
  216. }
  217. #endif
  218.  
  219. #if defined (__BORLANDC__)
  220. #  include <poppack.h>
  221. #endif
  222.  
  223. // Reset the packing level for DOS and Windows.
  224.  
  225. #if defined(__RPC_DOS__) || defined(__RPC_WIN16__)
  226. #pragma pack()
  227. #endif
  228.  
  229. #pragma option pop
  230. #endif /* __MIDLES_H__ */
  231.